{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "colab-install-julia.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "metadata": {
        "id": "cEOANYIVIdR5",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "# To run julia notebooks in colab, run this installation script first, should take 10-15 minutes.\n",
        "# From: @jekbradbury https://discourse.julialang.org/t/julia-on-google-colab-free-gpu-accelerated-shareable-notebooks/15319\n",
        "!wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb\n",
        "!dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb\n",
        "!apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub\n",
        "!apt update -q\n",
        "!apt install cuda gcc-6 g++-6 -y -q\n",
        "!ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc\n",
        "!ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++\n",
        "\n",
        "!curl -sSL \"https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.0-linux-x86_64.tar.gz\" -o julia.tar.gz\n",
        "!tar -xzf julia.tar.gz -C /usr --strip-components 1\n",
        "!rm -rf julia.tar.gz*\n",
        "!julia -e 'using Pkg; pkg\"add IJulia; add Knet; precompile\"'"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "metadata": {
        "id": "bqp7S32ULebR",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        ""
      ],
      "execution_count": 0,
      "outputs": []
    }
  ]
}